<div id="right">
    	<div id="news">
        	<h2><?php echo t("Project News"); ?></h2>
        	<?php
            $output = '';
            $nlimit = 1;
            $i = 1;
            $sql = "SELECT node_revisions.title, node_revisions.timestamp, node_revisions.body, node.type FROM {node}, {node_revisions} WHERE node.nid = node_revisions.nid AND node.type = 'news' ORDER BY node_revisions.timestamp DESC LIMIT $nlimit";
            $output .= "<div>";
            $result = db_query($sql);
            while ($anode = db_fetch_object($result)) {
				$output .= $anode->title. " " .$anode->body. " " .date("j M Y \a\\t G:i", $anode->timestamp);	
				$i++;
            }
            $output .= "</div>";
            print $output;
             ?>
        </div>
        <div id="updates"><h2><?php echo t("Updates from Partners"); ?></h2>
        	<div class='recent-updates' id='recent-updates'><ul class='recent-updates-list' id='recent-updates-ul'>
			</ul>
            <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">

    google.load("feeds", "1");

    function initialize() {
      var feed = new google.feeds.Feed("http://www.vtt.fi/news/rss/feeds/vtt_news_en.rss");
	  feed.setNumEntries(5);
      feed.load(function(result) {
        if (!result.error) {
          var container = document.getElementById("recent-updates-ul");
          for (var i = 0; i < result.feed.entries.length; i++) {
            var entry = result.feed.entries[i];
            var li = document.createElement("li");
			
			var entrydate=new Date(entry.publishedDate) //get date of entry
			var entrydatestr=' '+entrydate.getFullYear()+"/"+(entrydate.getMonth()+1)+"/"+entrydate.getDate()
			
           	var a = document.createElement("a");
			a.title = entry.title;
			a.innerHTML = entry.title;
			a.href = entry.link;
			a.target = "_blank";
		   	
		    li.appendChild(document.createTextNode(entrydatestr));
			li.appendChild(a);
					
            container.appendChild(li);
          }
        }
      });
    }
    google.setOnLoadCallback(initialize);

    </script>
            </div>
        </div>
</div><!--right-->